using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;

[CreateAssetMenu()]
public class MeshSettings : UpdatableData
{
    public const int numSupportedLODs = 5;
    public const int numSupportedChunkSizes = 9;
    public const int numSupportedFlatShadedChunkSIzes = 3;
    //无法设置为常量，只能设置为静态可读
    public static readonly int[] supportedChunkSizes = {48,72,96,120,144,168,192,216,240 };

    //地块整体scale
    public float meshScale = 1;
    public bool useFlatShding;
    
        
    [Range(0,numSupportedChunkSizes -1)]
    public int chunkSizeIndex;
    [Range(0,numSupportedFlatShadedChunkSIzes -1)]
    public int flatShadedchunkSizeIndex;
    
    public int numVertsPerLine
    {
        get
        {
            return supportedChunkSizes[(useFlatShding)?flatShadedchunkSizeIndex:chunkSizeIndex]+1;
        }
    }

    public float meshWorldSize
    {
        get
        {
            return (numVertsPerLine - 3) * meshScale;
        }
    }
    
}
